refs: resolve conflict between local/remote repos
authorYu Qi Zhang <jzehrarnyg@gmail.com>
Thu, 23 Jun 2016 16:11:50 +0000 (16:11 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 23 Jun 2016 19:52:26 +0000 (19:52 +0000)
commit02a2b689dda4fe69491d526a8e1f4f12f5a32bdf
tree95f13e3aae4ba9db936306d2efccaa03fcf60ed6
parentfc4a7ec35e6e7a3a2db80257508faa592329786c
refs: resolve conflict between local/remote repos

Add the functionality to use the same name for refs in local and remote
repos. This helps users keep track of local refs of remote origin, much
like local and remote git branches.

Previously, when a local ref is specified, resolve_refspec would fall
back to searching through remote repos if the ref is not found locally.
This function now takes an extra flag to specify whether it should
search through remote repos. Additionally, ostree_repo_resove_rev_ext
was added to call resolve_refspec with fallback_remote being false, so
refs --create would no longer complain when trying to create a local
ref of the same name as a remote one.

Fix remote repo parsing not being handled correctly on refs --create.

Closes: #363
Approved by: jlebon
apidoc/ostree-sections.txt
src/libostree/libostree.sym
src/libostree/ostree-repo-refs.c
src/libostree/ostree-repo.h
src/ostree/ot-builtin-refs.c
tests/test-refs.sh